package com.test.pattern.observer.jdkobserver;

/**
 * @ClassName: Client
 * @description:
 * @author: Mr du
 * @create: 2024-03-16 23:07
 */
public class Client {

    public static void main(String[] args) {
        //创建小偷对象
        Thief thief = new Thief("王二麻子");
        //创建警察对象
        Policemen policemen = new Policemen("正义的警察");
        //让警察盯着小偷
        thief.addObserver(policemen);
        //小偷偷东西
        thief.steal();
    }
}
